package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AdminPumpRecordMapper;
import com.ruoyi.system.domain.AdminPumpRecord;
import com.ruoyi.system.service.IAdminPumpRecordService;

/**
 * 抽水记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-11-13
 */
@Service
public class AdminPumpRecordServiceImpl implements IAdminPumpRecordService 
{
    @Autowired
    private AdminPumpRecordMapper adminPumpRecordMapper;

    /**
     * 查询抽水记录
     * 
     * @param id 抽水记录ID
     * @return 抽水记录
     */
    @Override
    public AdminPumpRecord selectAdminPumpRecordById(Long id)
    {
        return adminPumpRecordMapper.selectAdminPumpRecordById(id);
    }

    /**
     * 查询抽水记录列表
     * 
     * @param adminPumpRecord 抽水记录
     * @return 抽水记录
     */
    @Override
    public List<AdminPumpRecord> selectAdminPumpRecordList(AdminPumpRecord adminPumpRecord)
    {
        return adminPumpRecordMapper.selectAdminPumpRecordList(adminPumpRecord);
    }

    /**
     * 新增抽水记录
     * 
     * @param adminPumpRecord 抽水记录
     * @return 结果
     */
    @Override
    public int insertAdminPumpRecord(AdminPumpRecord adminPumpRecord)
    {
        adminPumpRecord.setCreateTime(DateUtils.getNowDate());
        return adminPumpRecordMapper.insertAdminPumpRecord(adminPumpRecord);
    }

    /**
     * 修改抽水记录
     * 
     * @param adminPumpRecord 抽水记录
     * @return 结果
     */
    @Override
    public int updateAdminPumpRecord(AdminPumpRecord adminPumpRecord)
    {
        adminPumpRecord.setUpdateTime(DateUtils.getNowDate());
        return adminPumpRecordMapper.updateAdminPumpRecord(adminPumpRecord);
    }

    @Override
    public int updateAdminPumpRecordByPeriodAndRoom(AdminPumpRecord adminPumpRecord) {
        return adminPumpRecordMapper.updateAdminPumpRecordByPeriodAndRoom(adminPumpRecord);
    }

    /**
     * 批量删除抽水记录
     * 
     * @param ids 需要删除的抽水记录ID
     * @return 结果
     */
    @Override
    public int deleteAdminPumpRecordByIds(Long[] ids)
    {
        return adminPumpRecordMapper.deleteAdminPumpRecordByIds(ids);
    }

    /**
     * 删除抽水记录信息
     * 
     * @param id 抽水记录ID
     * @return 结果
     */
    @Override
    public int deleteAdminPumpRecordById(Long id)
    {
        return adminPumpRecordMapper.deleteAdminPumpRecordById(id);
    }
}
